package com.vpclub;

import com.vpclub.extend.ExtConfig;
import org.junit.Test;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author : leimingchao
 * @date Date : 2021年06月22日 21:44
 */
public class IOCTest_Ext {


    @Test
    public void test() {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(ExtConfig.class);

        //发布事件
        applicationContext.publishEvent(new ApplicationEvent(new String("我发布的事件")) {

        });
        //容器关闭
        applicationContext.close();
    }
}
